<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-cn" xml:lang="zh-cn">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="DC.Type" content="topic">
  <meta name="DC.Title" content="退出集群安全模式">
  <meta name="DC.Format" content="XHTML">
  <meta name="DC.Identifier" content="Hive_00075">
  <meta name="DC.Language" content="zh-cn">
  <link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
  <title>退出集群安全模式</title>
 </head>
 <body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px">
  <a name="Hive_00075"></a><a name="Hive_00075"></a>
  <h1 class="topictitle1">退出集群安全模式</h1>
  <div>
   <p id="Hive_00075__zh-cn_topic_0000001896799592_p166081348141019">在大数据集群节点执行hdfs相关命令时，可能会出现“<span style="color:#4D4D4D;">Access denied for user root. Superuser privilege is required</span>”回显。可通过本节操作确认节点是否进入安全模式并退出安全模式。</p>
   <div class="section" id="Hive_00075__zh-cn_topic_0000001896799592_section18361820141010">
    <h4 class="sectiontitle">操作步骤</h4>
    <ol id="Hive_00075__zh-cn_topic_0000001896799592_ol12766194582818">
     <li id="Hive_00075__zh-cn_topic_0000001896799592_li1766124516282"><span>登录大数据集群中的任一NameNode节点。</span></li>
     <li id="Hive_00075__zh-cn_topic_0000001896799592_li1622374290"><a name="Hive_00075__zh-cn_topic_0000001896799592_li1622374290"></a><a name="zh-cn_topic_0000001896799592_li1622374290"></a><span>执行<strong id="Hive_00075__zh-cn_topic_0000001896799592_b738311167306">ps -ef|grep -i hdfs</strong>命令，查询当前是否有运行的hdfs进程，以下为进程存在的回显示例：</span><p></p><pre class="screen" id="Hive_00075__zh-cn_topic_0000001896799592_screen1657515390595">hdfs 16493 11954 2 15:19 ? 00:00:29 /usr/java/jdk1.7.0_67//bin/java -Dproc_namenode -Xmx1000m -Dhdfs.audit.logg
hdfs 16523 11954 1 15:19 ? 00:00:14 /usr/java/jdk1.7.0_67//bin/java -Dproc_secondarynamenode -Xmx1000m -Dhdfs.a</pre> <p></p></li>
     <li id="Hive_00075__zh-cn_topic_0000001896799592_li15011227183411"><span>若出现类似<a href="#Hive_00075__zh-cn_topic_0000001896799592_li1622374290">2</a>的回显，可依此执行以下命令切换到对应用户并离开安全模式。</span><p></p><pre class="screen" id="Hive_00075__zh-cn_topic_0000001896799592_screen545915371053">su - hdfs</pre> <pre class="screen" id="Hive_00075__zh-cn_topic_0000001896799592_screen1117613587511">hdfs dfsadmin -safemode leave</pre> <p></p></li>
    </ol>
    <p id="Hive_00075__zh-cn_topic_0000001896799592_p872210459615"></p>
   </div>
   <p id="Hive_00075__zh-cn_topic_0000001896799592_p8060118"></p>
  </div>
 </body>
</html>